//控制头像和聊天气泡的显示和移动
var times = 0;

function sendMessage() {
    document.getElementById('chat-bubble-rectangle').innerHTML = document.getElementById('chat-input').value;

    document.getElementById('chat-input').value = "";

    var chatHeadPortraitImg = document.getElementById('chat-head-portrait-img').cloneNode(true);
    var chatBubbleTriangle = document.getElementById('chat-bubble-triangle').cloneNode(true);
    var chatBubbleRectangle = document.getElementById('chat-bubble-rectangle').cloneNode(true);

    chatHeadPortraitImg.style.top = times * 80 + 66 + 'px';
    chatBubbleTriangle.style.top = times * 80 + 74 + 'px';
    chatBubbleRectangle.style.top = times * 80 + 60 + 'px';

    chatHeadPortraitImg.style.right = 550 + 'px';
    chatBubbleTriangle.style.right = 590 + 'px';
    chatBubbleRectangle.style.right = 605 + 'px';

    chatHeadPortraitImg.style.display = 'block';
    chatBubbleTriangle.style.display = 'block';
    chatBubbleRectangle.style.display = 'block';

    document.body.appendChild(chatHeadPortraitImg);
    document.body.appendChild(chatBubbleTriangle);
    document.body.appendChild(chatBubbleRectangle);

    times++;
}